import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.14
import QtQuick.Controls.Material 2.12

import "qrc:/_context/Basic"
import "qrc:/_context/CusCheckBox"
import "qrc:/_context/CusInput"
import "qrc:/_context/CusGroupBox"
import "qrc:/_context/Container"
import "qrc:/_context/Modbus"
import "qrc:/_context/CusButton"

Item {
    Column{
        anchors.fill: parent;
        anchors.margins: 20;
        spacing: 50;

        RowLayout{
            spacing: 20;

            // 按钮：配置数据入库
            CusButton{
                width: 90;
                height: 42;
                text: "配置数据入库";
                onClicked: {
                    var tipStr = DBControl.modbusJson2DB();

                    interval: 2000;

                    DBControl.topicInfo2DB();

                    // tip.text = tipStr;
                }
            }

            // 提示
            YaheiText{
                id: tip;
                text: "提示：";
            }
        }

        RowLayout{
            spacing: 20;

            // 按钮：配置数据入库
            CusButton{
                width: 90;
                height: 42;
                text: "工况点描述";
                onClicked: {
                    // var tipStr = DBControl.createTables();

                    DBControl.msgPointDesc2DB();

                    // tip.text = tipStr;
                }
            }

            // 提示
            YaheiText{
                id: tip2;
                text: "提示：";
            }
        }


        // AnimatedImage{
        //     id: loading;
        //     source: "qrc:/imgs/loading.gif";
        // }
    }
}
